home *** CD-ROM | disk | FTP | other *** search
-
- fsm EasyBot : integer;
-
-
- //------------------------------------------------------------------
-
- // EasyBot:
- // Intended to be a moderately easy opponent for all players,
- // though a bit more challenge than a WussyBot.
-
- //------------------------------------------------------------------
-
-
- //------------------------------------------------------------------
- // Constants
- //------------------------------------------------------------------
-
- const
- #include_ <content\ABLScripts\mwconst.abi>
-
- //------------------------------------------------------------------
- // Types
- //------------------------------------------------------------------
-
- type
- #include_ <content\ABLScripts\mwtype.abi>
-
-
- //------------------------------------------------------------------
- // Variables
- //------------------------------------------------------------------
-
- var
- static integer attackRange; // At what range do I start shooting?
- static integer withdrawRange; // At what range do I withdraw?
-
- //------------------------------------------------------------------
- // Init: my initialization function
- //------------------------------------------------------------------
-
- function Init;
- code
- // script-specific variables
- attackRange = 9999;
- withdrawRange = 9999;
-
- SetIgnoreFriendlyFire (ME,true);
- SetFiringDelay (ME,2.0,6.0);
- SetSkillLevel (ME,10,15,0);
- SetAttackThrottle (ME,50);
- SetIsShotRadius (ME,160);
- SetEntropyMood (ME,DEFENSIVE_END);
- SetCurMood (ME,DEFENSIVE_END);
-
- EnablePerWeaponRayCasting (ME,TRUE);
-
- endfunction;
-
- //------------------------------------------------------------------
- // StartState: my initial state
- //------------------------------------------------------------------
-
- state StartState;
- code
- trans WaitToAmbushState;
-
- endstate;
-
- //------------------------------------------------------------------
- // WaitInAmbushState: wait for someone to come close enough to attack
- //------------------------------------------------------------------
-
- state WaitToAmbushState;
- code
- if (Bot_FindEnemy(attackrange)) then
- trans AttackState;
- endif;
-
- OrderMoveLookOut;
- endstate;
-
- //------------------------------------------------------------------
- // AttackState: the ambush is over -- let's kick some ass!
- //------------------------------------------------------------------
-
- state AttackState;
- code
- if (LeaveAttackState(withdrawRange)) then
- trans WaitToAmbushState;
- endif;
-
- OrderAttack(TRUE);
- endstate;
-
- //------------------------------------------------------------------
- // DeadState: OK, I kicked the bucket.
- //------------------------------------------------------------------
-
- state DeadState;
- code
- orderDie;
-
- endstate;
-
-
- endfsm.
-
-